<template>
	<view class="classifyLayout pageBg">
		<nav-bar title="分类"></nav-bar>
		<!-- <uv-skeletons :loading="classesLoading" :skeleton="classesSkeleton"> -->
			<view class="classify">
				<theme-item v-for="(item, index) in classes" :key="item._id" :value="item"></theme-item>
			</view>
		<!-- </uv-skeletons> -->
		<!-- #ifdef H5 -->
		<nav-fill></nav-fill>
		<!-- #endif -->
	</view>
</template>

<script setup>
import {ref} from 'vue'
import { apiGetClassifyList } from '@/api/index.js'
import { onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'

const classesLoading = ref(true)
	
const classes = ref([])
const getClasses = async () => {
	let data = await apiGetClassifyList({pageNum:1, pageSize:15})
	classes.value = data.list
	classesLoading.value = false
}

// 分享给好友
onShareAppMessage(e=>{
	return {
		title: "咸虾米壁纸-壁纸主题",
		path:'/pages/classify/classify'
	}
})

// 分享朋友圈
onShareTimeline(e=>{
	return {
		title: '咸虾米壁纸-壁纸主题'
	}
})

getClasses()
</script>

<style lang="scss" scoped>
.classifyLayout{
	.classify{
		padding: 10rpx;
		display: grid;
		gap: 15rpx;
		grid-template-columns: repeat(3,1fr);
		min-height: calc(100% - 20rpx); /* 确保内容高度 */
	}
}
</style>
